import { createRouter, createWebHashHistory } from "vue-router";
const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: "/",
      name: "首页",
      components: {
        default: () => import("../pages/index"),
        footer: () => import("../components/LmFooter/index"),
      },
    },
    {
      path: "/new",
      name: "消息",
      components: {
        default: () => import("../pages/new"),
        footer: () => import("../components/LmFooter/index"),
      },
    },
    {
      path: "/serviceTim",
      name: "聊天页",
      components: {
        default: () => import("../pages/serviceTim/index"),
      },
    },
    {
      path: "/test",
      name: "测试页",
      components: {
        default: () => import("../pages/test"),
      },
    },
    {
      path: "/my",
      name: "我的",
      components: {
        default: () => import("../pages/my"),
        footer: () => import("../components/LmFooter/index"),
      },
    },
    {
      path: "/login",
      name: "登录",
      components: {
        default: () => import("../pages/login"),
      },
    },
    {
      path: "/applicationList",
      name: "申请列表",
      components: {
        default: () => import("../pages/applicationList/index"),
      },
    },
    {
      path: "/richdimensional",
      name: "我的共富码",
      components: {
        default: () => import("../pages/richdimensional/index"),
      },
    },
    {
      path: "/helpTeachExperience",
      name: "帮授经验",
      components: {
        default: () => import("../pages/helpTeachExperience/index"),
      },
    },
    {
      path: "/collateralSupply",
      name: "帮保供",
      components: {
        default: () => import("../pages/collateralSupply/index"),
      },
    },
    {
      path: "/traceabilityRecord",
      name: "溯源记录",
      components: {
        default: () => import("../pages/traceabilityRecord/index"),
      },
    },
    {
      path: "/authorizationRecord",
      name: "授权记录",
      components: {
        default: () => import("../pages/authorizationRecord/index"),
      },
    },
    {
      path: "/affluentIntegral",
      name: "共富积分",
      components: {
        default: () => import("../pages/affluentIntegral/index"),
      },
    },
    {
      path: "/exchange",
      name: "奖励兑换",
      components: {
        default: () => import("../pages/exchange/index"),
      },
    },
    {
      path: "/helpPolicy",
      name: "帮政策",
      components: {
        default: () => import("../pages/helpPolicy/index"),
      },
    },
    {
      path: "/helpStorage",
      name: "帮存储",
      components: {
        default: () => import("../pages/helpStorage/index"),
      },
    },
    {
      path: "/gangbrand",
      name: "帮品牌",
      components: {
        default: () => import("../pages/gangbrand/index"),
      },
    },
    {
      path: "/myBrand",
      name: "我的品牌",
      components: {
        default: () => import("../pages/myBrand/index"),
      },
    },
    {
      path: "/brandApplication",
      name: "品牌申请",
      components: {
        default: () => import("../pages/brandApplication/index"),
      },
    },
    {
      path: "/brandDetails",
      name: "品牌详情",
      components: {
        default: () => import("../pages/brandDetails/index"),
      },
    },
    {
      path: "/applicationRecord",
      name: "申请记录",
      components: {
        default: () => import("../pages/applicationRecord/index"),
      },
    },
    {
      path: "/assortingVarietydh",
      name: "帮选品种(大户)",
      components: {
        default: () => import("../pages/assortingVarietydh/index"),
      },
    },
    {
      path: "/assortingVarietyxh",
      name: "帮选品种(小户)",
      components: {
        default: () => import("../pages/assortingVarietyxh/index"),
      },
    },
    {
      path: "/seedPurchase",
      name: "代购种子",
      components: {
        default: () => import("../pages/seedPurchase/index"),
      },
    },
    {
      path: "/encyclopediaVarietyDetails", // 已弃用 老页面 新页面varietyDetails
      name: "百科品种详情",
      components: {
        default: () => import("../pages/encyclopediaVarietyDetails/index"),
      },
    },
    {
      path: "/intelligentRecommendation",
      name: "种子大厅",
      components: {
        default: () => import("../pages/intelligentRecommendation/index"),
      },
    },
    {
      path: "/varietyDetails",
      name: "品种详情",
      components: {
        default: () => import("../pages/varietyDetails/index"),
      },
    },
    {
      path: "/helpSelectionRecord",
      name: "帮选记录",
      components: {
        default: () => import("../pages/helpSelectionRecord/index"),
      },
    },

    {
      path: "/agriculturalTechnologyClassDetial",
      name: "课件详情",
      components: {
        default: () =>
          import("../pages/agriculturalTechnologyClassDetial/index"),
      },
    },
    {
      path: "/listExperts",
      name: "专家列表",
      components: {
        default: () => import("../pages/listExperts/index"),
      },
    },
    {
      path: "/brandEncyclopedia",
      name: "品种百科",
      components: {
        default: () => import("../pages/brandEncyclopedia/index"),
      },
    },

    {
      path: "/traceableResult",
      name: "溯源结果",
      components: {
        default: () => import("../pages/traceableResult/index"),
      },
    },
    {
      path: "/traceabilityApplication",
      name: "溯源申请",
      components: {
        default: () => import("../pages/traceabilityApplication/index"),
      },
    },
    {
      path: "/deviceList",
      name: "设备列表",
      components: {
        default: () => import("../pages/deviceList/index"),
      },
    },
    {
      path: "/deviceDetails",
      name: "设备详情",
      components: {
        default: () => import("../pages/deviceDetails/index"),
      },
    },
    {
      path: "/appointmentApplication",
      name: "预约申请",
      components: {
        default: () => import("../pages/appointmentApplication/index"),
      },
    },
    {
      path: "/behalfBuyRecord",
      name: "代购记录",
      components: {
        default: () => import("../pages/behalfBuyRecord/index"),
      },
    },
    {
      path: "/detectionRecord",
      name: "检测记录",
      components: {
        default: () => import("../pages/detectionRecord/index"),
      },
    },
    {
      path: "/helpPolicyDetails",
      name: "政策详情",
      components: {
        default: () => import("../pages/helpPolicyDetails/index"),
      },
    },
    {
      path: "/agriculturalTechnologyClassDetial",
      name: "课件详情",
      components: {
        default: () =>
          import("../pages/agriculturalTechnologyClassDetial/index"),
      },
    },
    {
      path: "/supplyTaskList",
      name: "任务列表",
      components: {
        default: () => import("../pages/supplyTaskList/index"),
      },
    },
    {
      path: "/supplyTaskListDetail", //页面接口没对接
      name: "任务详情",
      components: {
        default: () => import("../pages/supplyTaskListDetail/index"),
      },
    },
    {
      path: "/formationDetail",
      name: "结队详情", // 结队大/小户详情
      components: {
        default: () => import("../pages/formationDetail/index"),
      },
    },
    {
      path: "/applicationSuccess",
      name: "申请成功",
      components: {
        default: () => import("../pages/applicationSuccess/index"),
      },
    },
    {
      path: "/employmentRecords",
      name: "用工记录",
      components: {
        default: () => import("../pages/employmentRecords/index"),
      },
    },
    {
      path: "/applicationSuccess",
      name: "申请成功",
      components: {
        default: () => import("../pages/applicationSuccess/index"),
      },
    },
    {
      path: "/helpUnsalable",
      name: "帮滞销",
      components: {
        default: () => import("../pages/helpUnsalable/index"),
      },
    },
    {
      path: "/unsalableRecord",
      name: "滞销记录",
      components: {
        default: () => import("../pages/unsalableRecord/index"),
      },
    },
    {
      path: "/unsalableApplication",
      name: "滞销申请",
      components: {
        default: () => import("../pages/unsalableApplication/index"),
      },
    },
    {
      path: "/helpRecords",
      name: "帮工记录",
      components: {
        default: () => import("../pages/helpRecords/index"),
      },
    },
    {
      path: "/sendRecords",
      name: "发布记录",
      components: {
        default: () => import("../pages/sendRecords/index"),
      },
    },

    {
      path: "/helpEmployingRichWorkers",
      name: "帮用工",
      components: {
        default: () => import("../pages/helpEmployingRichWorkers/index"),
      },
    },
    {
      path: "/helpEmployingDetail",
      name: "帮工详情",
      components: {
        default: () => import("../pages/helpEmployingDetail/index"),
      },
    },
    {
      path: "/helpTraceabilityDh",
      name: "帮溯源(大户)",
      components: {
        default: () => import("../pages/helpTraceabilityDh/index"),
      },
    },
    {
      path: "/helpTraceabilityXh",
      name: "帮溯源(小户)",
      components: {
        default: () => import("../pages/helpTraceabilityXh/index"),
      },
    },
    {
      path: "/sedNeedEmploying",
      name: "发布用工需求",
      components: {
        default: () => import("../pages/sedNeedEmploying/index"),
      },
    },
    {
      path: "/appointmentDetail",
      name: "预约大户详情(小户)",
      components: {
        default: () => import("../pages/appointmentDetail/index"),
      },
    },
    {
      path: "/feedBack",
      name: "意见反馈",
      components: {
        default: () => import("../pages/feedBack/index"),
      },
    },
    /* 详情模版 /formationDetail   /deviceDetails */
    /* 列表模板 /authorizationRecord */
    {
      path: "/partneredList",
      name: "结队申请", //大/小户列表
      components: {
        default: () => import("../pages/partneredList/index"),
      },
    },
    {
      path: "/farmDetail",
      name: "农场详情",
      components: {
        default: () => import("../pages/farmDetail/index"),
      },
    },
    {
      path: "/helpExhibitSell",
      name: "帮展销",
      components: {
        default: () => import("../pages/helpExhibitSell/index"),
      },
    },
    {
      path: "/exhibitionDetail",
      name: "展会详情",
      components: {
        default: () => import("../pages/exhibitionDetail/index"),
      },
    },
    {
      path: "/choiceness",
      name: "精选农资-大户",
      components: {
        default: () => import("../pages/choiceness/index"),
      },
    },
    {
      path: "/farmProductsUseDh",
      name: "大户使用农资-小户",
      components: {
        default: () => import("../pages/farmProductsUseDh/index"),
      },
    },
    {
      path: "/eachRichData",
      name: "共富数据",
      components: {
        default: () => import("../pages/eachRichData/index"),
      },
    },
    {
      path: "/choicenessXh",
      name: "精选农资-小户",
      components: {
        default: () => import("../pages/choicenessXh/index"),
      },
    },
    {
      path: "/farmProductsHall",
      name: "农资大厅-小户",
      components: {
        default: () => import("../pages/farmProductsHall/index"),
      },
    },
    {
      path: "/behalfBuyApplication",
      name: "申请代购-小户", // 代购农资
      components: {
        default: () => import("../pages/behalfBuyApplication/index"),
      },
    },
    {
      path: "/farmProductDetail",
      name: "商品详情-大户", // 农资详情
      components: {
        default: () => import("../pages/farmProductDetail/index"),
      },
    },
    {
      path: "/farmProductMy",
      name: "我的农资-大户",
      components: {
        default: () => import("../pages/farmProductMy/index"),
      },
    },
    {
      path: "/helpDetectionDh",
      name: "帮检测-大户",
      components: {
        default: () => import("../pages/helpDetectionDh/index"),
      },
    },
    {
      path: "/helpDetectionXh",
      name: "帮检测-小户",
      components: {
        default: () => import("../pages/helpDetectionXh/index"),
      },
    },
    {
      path: "/detectionHomepage",
      name: "检测主页-大户",
      components: {
        default: () => import("../pages/detectionHomepage/index"),
      },
    },
    {
      path: "/equipmentDetail",
      name: "设备详情-大户",
      components: {
        default: () => import("../pages/equipmentDetail/index"),
      },
    },
    {
      path: "/detectionDhDetail",
      name: "帮检测大户详情-小户",
      components: {
        default: () => import("../pages/detectionDhDetail/index"),
      },
    },
    {
      path: "/detectionReport", // 这个版本不做
      name: "检测报告-小户",
      components: {
        default: () => import("../pages/detectionReport/index"),
      },
    },
    {
      path: "/myHomePage",
      name: "我的主页-大/小户",
      components: {
        default: () => import("../pages/myHomePage/index"),
      },
    },
    {
      path: "/partneredApplication",
      name: "结队申请-大户", // 申请列表-大户
      components: {
        default: () => import("../pages/partneredApplication/index"),
      },
    },
    {
      path: "/farmProductDetailXh",
      name: "农资详情-小户",
      components: {
        default: () => import("../pages/farmProductDetailXh/index"),
      },
    },
    {
      path: "/detectionResult",
      name: "检测结果-小户", // 这个版本不做
      components: {
        default: () => import("../pages/detectionResult/index"),
      },
    },
    {
      path: "/helpCenter",
      name: "帮助中心",
      components: {
        default: () => import("../pages/helpCenter/index"),
      },
    },
    {
      path: "/userInfo",
      name: "个人资料",
      components: {
        default: () => import("../pages/userInfo/index"),
      },
    },
    {
      path: "/partneredMap",
      name: "结队地图",
      components: {
        default: () => import("../pages/partneredMap/index"),
      },
    },
    {
      path: "/demonstrationMap",
      name: "数字基地示范点",
      components: {
        default: () => import("../pages/demonstrationMap/index"),
      },
    },
    {
      path: "/technologyClassroom",
      name: "农技课堂",
      components: {
        default: () => import("../pages/technologyClassroom/index"),
      },
    },
    {
      path: "/farmProductEncyclopedia",
      name: "农资百科", // 精选农资-品种百科-小户
      components: {
        default: () => import("../pages/farmProductEncyclopedia/index"),
      },
    },
    {
      path: "/trainingDetails",
      name: "培训会详情",
      components: {
        default: () => import("../pages/trainingDetails/index"),
      },
    },
    {
      path: "/helpCenterDetails",
      name: "帮助中心详情",
      components: {
        default: () => import("../pages/helpCenterDetails/index"),
      },
    },
    {
      path: "/helpWorkDetail",
      name: "帮用工编辑页", //小户
      components: {
        default: () => import("../pages/helpWorkDetail/index"),
      },
    },
  ],
});
router.beforeEach((data) => {
  if (data.query.token) {
    document.cookie = `satoken=${data.query.token};path=/;`;
  }
});
export default router;
